package com.yqg.manage.mapper;

import com.yqg.manage.controller.dto.DossierDto;
import com.yqg.manage.entity.Dossier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zxf
 * @since 2024-06-06
 */
@Mapper
public interface DossierMapper extends BaseMapper<Dossier> {

    /**
     * 案件请求获取卷宗数据
     */
    List<DossierDto> getAllDossierName(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,
                                       @Param("search") String search, @Param("userId") Long userId,
                                       @Param("unitId") Long unitId);
    Integer getAllDossierNameCount(@Param("search") String search, @Param("userId") Long userId,
                                   @Param("unitId") Long unitId);

    /**
     * 分页查询
     *
     * @param userId 副主任查其他部门
     * @param unitId 查询单独部门
     */
    List<Dossier> getPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,
                          @Param("search") String search, @Param("userId") Long userId,
                          @Param("unitId") Long unitId);

    Integer getPageCount(@Param("search") String search, @Param("userId") Long userId,
                         @Param("unitId") Long unitId);


}
